package com.powernode.mybatis.dao.impl;

import com.powernode.mybatis.dao.AccountDao;
import com.powernode.mybatis.pojo.Account;
import com.powernode.mybatis.utils.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * author 金宇廷的星空
 * version 1.0
 * date  2023/4/10 19:11
 * poject Mybatis
 */
public class AccountDaoImpl implements AccountDao {

    @Override
    public Account selectByActno(String toActno) {
        SqlSession sqlSession = SqlSessionUtil.openSession();
        Account account  =(Account) sqlSession.selectOne("sqlId", toActno);
        sqlSession.close();
        return account;
    }

    @Override
    public int updateByActno(Account act) {
        SqlSession sqlSession = SqlSessionUtil.openSession();
        int count = sqlSession.update("sqlId1", act);
        return count;
    }
}
